class AjaxUtils{
    constructor(){}
    ajaxRequest(url,callback,param={}){
    	let xhr=new XMLHttpRequest();
        xhr.open('get',url,false);
        xhr.addEventListener("readystatechange",()=>{
        	if(xhr.readyState==4&&xhr.status==200){
            	callback(xhr);
            }
        },false);
        xhr.send();
    }
    ajaxRequestPost(url,callback,param){
    	let xhr=new XMLHttpRequest();
    	xhr.open("post",url,true);
    	xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    	xhr.addEventListener("readystatechange",()=>{
        	if(xhr.readyState==4&&xhr.status==200){
            	callback(xhr);
            }
        },false);
        xhr.send(param);
    }
}